<div class="photos">
    <div class="title">Мои фотографии</div>
    <div class="clear10"></div>
    <a href="#" class="btnUploadPhoto">Загрузить фото</a>
    <input type="file" multiple id="file" name="photos[]" style="visibility:hidden; position:absolute; top:-10000px;">
    <div class="clear10"></div>
    <script>
		function displayFiles(files){
			$.each(files, function(i, file) {      
			  if (!file.type.match(/image.*/)) {
				return true;
			  }         
			  $('.progress .pr').css({width:'0%'}).html('0%');
			  var li = $('<a/>').attr('href','javascript:void(0);').prependTo('.listPhotos');
			  var img = $('<img/>').appendTo(li);
			  li.get(0).file = file;
			  var reader = new FileReader();
			  reader.onload = (function(aImg) {
				return function(e) {
					send('set_photos',e.target.result,function(response){ console.log(response); });
				    aImg.attr('src', e.target.result);
				};
			  })(img);
			  
			  reader.readAsDataURL(file);
			});
		}
		$(document).ready(function(){
    		$(".btnUploadPhoto").click(function(){
				$('#file').click();
			});
			$('#file').change(function(){
				displayFiles(this.files);
			});
			send('get_photos','',function(response){  console.log(response);
				$.each(response.req,function(i,v){
					 var li = $('<a/>').attr('href','javascript:void(0);').prependTo('.listPhotos');
					 var img = $('<img/>').appendTo(li);
					 img.attr('src',v['i'])
				});	
			});
		}); 
    </script>
    <div align="center">
    <div class="progress" align="left"><div class="pr"></div></div>
    </div>
    <div class="listPhotos"></div>
</div>